
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <pthread.h>
#include <semaphore.h>

#include "gui_object.h"
#include "gui_entry.h"
#include "task_manager.h"
#include "task_test.h"
#include <stdio.h>

GUI_CONSOLE_INIT(gs_console);

sj_task_t task;

int main(int argc, char const *argv[])
{
    char name[20] = "lcd";
    gui_entry_get(&gs_console);//to desktop

    char enter = '0';
    printf("show Desktop\n");

//    task.name = name;
//    task.task.private_ptr = &gs_console;
//    task.task.periodtime = 20000;
//    task.run_func = run_task;
//    sj_task_create(&task);
    while(1)
    {
        printf("please input search object: menu:m; up:u; down:d; ok:o; quit:q.");
        printf("your choice:");
        enter = getchar();
        switch (enter)
        {
            case 'm':
                gui_object_go_back_to_parent(&gs_console);
                //gs_console.current_input_type = BUTTON_MENU;
                //set_type(BUTTON_MENU);
                break;

            case 'u':
                gui_object_go_peer_priv(&gs_console);
                //gs_console.current_input_type = BUTTON_UP;
                //set_type(BUTTON_UP);
                break;

            case 'd':
                gui_object_go_peer_next(&gs_console);
                //gs_console.current_input_type = BUTTON_DOWN;
                //set_type(BUTTON_DOWN);
                break;

            case 'o':
                gui_object_into_child(&gs_console);
                //gs_console.current_input_type = BUTTON_OK;
                //set_type(BUTTON_OK);
                 break;

            case 'q':
                return 0;
                break;
        }
        getchar();
    }

    return 0;
}
